<template id="admin">
  <div>
    <!-- <group title="2017-04-04" v-for="n in 2"> -->
      <div v-for="item in data" class="home-item" @click="popup">
        <p>异常问题：</p>
        <p>{{ item.report_content }}</p>
<!--         <p>审批意见：</p>
        <p>{{ item.admin }}</p>
        <p>抄送单位：</p>
        <p>{{ item.notice }}</p> -->
        <p>{{ item.report_time }}</p>
      </div>
    <!-- </group> -->
    <x-button type="primary" action-type="button" @click.native="popup">发布</x-button>

    <popup v-model="show" class="popup">
      <group style="width: 90%; margin: 0 5% 10px;">
        <x-textarea v-model="post.content" placeholder="请批示" :max="max"></x-textarea>
      </group>
      <x-button type="primary" action-type="button" @click.native="submit">提交</x-button>
    </popup>
  </div>
</template>

<script>
  var admin = {
    template: '#admin',
    components: {
      popup: vuxPopup,
      group: vuxGroup,
      xButton: vuxXButton,
      xTextarea: vuxXTextarea
    },
    data: function() {
      return {
        data: [],
        show: false,
        max: 140,
        post: {
          content: ''
        }
      }
    },
    methods: {
      popup: function() {
        this.show = true
      },
      submit: function() {
        this.show = false
      }
    },
    created: function() {
      var _this = this
      this.$vux.loading.show({
        text: 'Loading'
      })
      axios.get('get_admin')
        .then(function(res) {
          _this.data = res.data
          _this.$root.$vux.loading.hide()
        })
    },
  }
</script>